package com.example.tg.Controller;

import api.house.HouseApi;
import com.example.tg.Service.House_orderService;
import com.github.pagehelper.PageInfo;
import dto.Dto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import pojo.House_order;
import pojo.ListHo;

import java.util.List;

@Controller
public class HouseController implements HouseApi {
    @Autowired
    private House_orderService house_orderService;
    @Override
    public Dto<Integer> addHo(House_order house_order) {
        Dto<Integer> dto = new Dto<>();
        dto.setObj(house_orderService.addHo(house_order));
        return dto;
    }

    @Override
    public Dto<Integer> deleHo(String id) {
        Dto<Integer> dto = new Dto<>();
        dto.setObj(house_orderService.deleHo(id));
        return dto;
    }

    @Override
    public Dto<PageInfo<House_order>> listHo(ListHo listHo) {
        Dto<PageInfo<House_order>> dto = new Dto<>();
        dto.setObj(house_orderService.listHo(listHo));
        return dto;
    }

    @Override
    public Dto<Integer> contHo() {
        Dto<Integer> dto = new Dto<>();
        dto.setObj(house_orderService.contHo());
        return dto;
    }
}
